 #define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
typedef struct Node
{
	int date;
	struct Node* next;
}Node;
Node* CreatList()
{
	Node* pf= NULL;
	Node* head = NULL;
	Node* tep = NULL;
	int num = 0;
	scanf("%d", &num);
	while (num != -1)
	{
		pf = (Node*)malloc(sizeof(Node));
		assert(head);
		pf->date = num;
		pf->next = NULL;
		if (head == NULL)
		{
			head = pf;
			tep = pf;
		}
		else
		{
			tep->next = pf;
			tep = pf;
		}
		scanf("%d", &num);
	}
}
void printList(Node* p)
{
	Node* temp = p;
	while (temp != NULL)
	{
		printf("%d", temp->date);
		temp = temp->next;
	}
}
int main()
{
	int num = 0;
	scanf("%d", &num);
	Node* head = CreatList();
	printList(head);
	return 0;
}